package com.ytkj.tradeserver.service.impl;

import com.github.pagehelper.PageHelper;
import com.ytkj.tradeserver.dao.IPushMessageDataDao;
import com.ytkj.tradeserver.entity.PushMessageInfoVO;
import com.ytkj.tradeserver.model.PageBean;
import com.ytkj.tradeserver.service.iservice.IPushMessageDataService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * Created by Administrator on 2017/3/3.
 */
@Service
public class PushMessageDataService implements IPushMessageDataService{

    @Resource
    private IPushMessageDataDao pushMessageDataDao;

    //保存推送信息
    public int savePushMessageData(PushMessageInfoVO message){
      return  pushMessageDataDao.savePushMessageData(message);
    }

    public PageBean<PushMessageInfoVO> queryAllPushMessage(String url,PushMessageInfoVO message,PageBean pageBean){
        PageHelper.startPage(pageBean.getPageNum(), pageBean.getPageSize());
        List<PushMessageInfoVO> list = pushMessageDataDao.queryAllPushMessage(message);
       return new PageBean<>(list,url);
    }
}
